<template>
    <div>
<el-row>
      <el-col :span="1" >
        <i class="el-icon-s-operation" style="font-size: 1.5em;position: relative;top: 23px;"></i>
        </el-col>
        <el-col :span="5" >
            <h4 style="color: dimgrey;position: relative;right: 23px;" >成都市十全十美黄金有限公司</h4>
        </el-col>
        <el-col :span="1" :offset="14">
            <i class="el-icon-user" @click="updatePwd" style="font-size: 2em;position: relative;top: 15px;"></i>
        </el-col>

        <el-col :span="2" style="position: relative;top: 20px;">
       你好！
       <h style="color: cornflowerblue;">{{ allname }}</h>

        </el-col>
  <el-col :span="1">
    <i class="el-icon-circle-close" @click="logout" type="warning" style="font-size: 2em;position: relative;top: 15px;"></i>
  </el-col>
</el-row>

    </div>
  </template>
  <script>


  export default {
    name: "alltop",
    data() {
      return {

        allname:""
      };
    },
    methods:{
      updatePwd(){
        this.$router.push("/addBuy")
      },
      logout(){
        localStorage.removeItem('access_token')
        this.$router.push("/")
        this.$message.success("退出成功")
      },
find:function () {
  this.$axios.get("/user/getAllUser" ).then(res => {
        console.log(res)
        this.allname=res.data.data.account
        window.localStorage.setItem("account",this.allname)
      })

}


  },
  mounted: function () {
    this.find();


  },
  }
  </script>

  <style  scoped>

  </style>

